using System;
using System.Collections.Generic;
using System.Text;

namespace Doubler.Templates.Recorder.RecorderActions
{
    public abstract class RecorderActionBase : IRecorderAction
    {

        protected abstract void doAct(Refly.CodeDom.IClassDeclaration recorder, Refly.CodeDom.MethodDeclaration recorderMethod, Refly.CodeDom.Expressions.NativePropertyReferenceExpression recordingProperty, Reflector.CodeModel.ITypeReference subject, Reflector.CodeModel.IMethodDeclaration methodInformation);

        #region IRecorderAction Members

        public void Act(Refly.CodeDom.IClassDeclaration recorder
            , Refly.CodeDom.MethodDeclaration recorderMethod
            , Refly.CodeDom.Expressions.NativePropertyReferenceExpression recordingProperty
            , Reflector.CodeModel.ITypeReference subject
            , Reflector.CodeModel.IMethodDeclaration methodInformation)
        {
            this.doAct(recorder, recorderMethod, recordingProperty, subject, methodInformation);
            if (this.ActionDecorator != null)
                this.ActionDecorator.Act(recorder, recorderMethod, recordingProperty, subject, methodInformation);
        }

        private IRecorderAction _ActionDecorator;

        public IRecorderAction ActionDecorator
        {
            get
            {
                return _ActionDecorator;
            }
            set
            {
                _ActionDecorator = value;
            }
        }

        #endregion
    }
}
